<%@page import="java.util.Locale"%>
<%@page import="java.util.ResourceBundle"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.sql.Date"%>
<%@page import="com.googlecode.objectify.Query"%>
<%@page import="server.Utils"%>
<%@page import="model.Articles"%>
<%@page import="java.util.ArrayList"%>
<%@page import="javax.cache.CacheException"%>
<%@page import="java.util.Collections"%>
<%@page import="javax.cache.CacheManager"%>
<%@page import="javax.cache.Cache"%>
<% request.setCharacterEncoding("utf-8"); %>
<%
Query<Articles> list = (Query<Articles>) request.getAttribute("list");
String author = (String) request.getAttribute("author");
SimpleDateFormat dt = new SimpleDateFormat("MM-dd-yyyy");
ResourceBundle resource = ResourceBundle.getBundle("language",
		new Locale("en"));

String title = resource.getString("title_author")+" - "+author;
String description =resource.getString("title_author")+" "+author+". "+ resource.getString("description_author");
String keyword = author+","+resource.getString("keyword_author");
%>

<jsp:include page="/layout/header.jsp">
	<jsp:param name="title" value='<%=title %>'/>
	<jsp:param name="description" value='<%=description %>'/>
	<jsp:param name="keywords" value='<%=keyword %>'/>
</jsp:include>

	<div class="bd">
		<div class="bdl">
			<%@ include file='/adv/250x250.jsp'%><br/><br/>
			<%@ include file='/adv/250x250.jsp'%>
		</div>
		<div class="bdr">
			<h2><%=resource.getString("author_article") %> : <%=author %></h2>
			<hr size="1"/>
			
			<%
			for (Articles ar: list) {
			%>
				<h3><a href="/article/<%=ar.getAlias()%>"><%=ar.getTitle().getValue() %></a></h3>
				<p class="at">Author: <span><%=ar.getAuthor() %></span>  | Date: <span><%=dt.format(new Date(ar.getDate()))  %></span></p>
				<p><%=Utils.description(ar.getContent().getValue()) %></p>
			<%
			}
			%>
			
		</div>
	</div>

<%@ include file='/layout/footer.jsp'%>			